package com.steven.concurrency.example.singleton;

/**
 * 饿汉式
 */
public class EhanSingleton {

    private EhanSingleton(){

    }
 /*   private static  EhanSingleton singleton = new EhanSingleton();
  */
    private static EhanSingleton getinstance(){
        return  singleton;
    }

    /**
     * 使用静态代码串
     */
    private static  EhanSingleton singleton =null;
    static{
        singleton = new EhanSingleton();
    }

}
